<template>
  <div>
    <TopBar title="vip开通记录"></TopBar>
    <div class="item" v-for="item in vip_list" :key="item">
      <div>
        <div class="line1">{{ item.vip_name }}</div>
        <div class="line2">开通时间：{{ item.open_time }}</div>
        <div class="line3">有效期至：{{ item.end_time }}</div>
      </div>
      <div class="price">￥{{ item.amount }}</div>
    </div>
  </div>
</template>

<script>
import TopBar from "@/components/TopBar";

export default {
  name: "VipRecordView.vue",
  components: {
    TopBar,
  },
  data() {
    return {
      vip_list: [],
    }
  },
  mounted() {
    this.getData()
  },
  methods: {
    getData() {
      this.$axios.get("/user/vip/record").then(res => {
        if (res.data.code == 200) {
          this.vip_list = res.data.data
        }
      })
    }
  }
}
</script>

<style scoped>
.item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
}

.line1 {
  color: red;
  margin: 5px 0;
}

.line2, .line3 {
  color: #999999;
}

.price {
  color: red;
  font-size: 22px;
}
</style>